﻿using FreeSql.DataAnnotations;
using Rswl.Common.Core.User.Aggregate.Entities;
using System.Text.Json.Serialization;

namespace Plugin.Archives.Models
{
	[Table(Name ="baoming")]
	public class BaomingInfo
	{
		[JsonPropertyName("id")]
		[Column(IsIdentity =true,IsPrimary =true)]
        public long Id { get; set; }
		[JsonPropertyName("interestData")]
		public string InterestData { get; set; }
		[JsonPropertyName("interestValue")]
		[Column(IsIgnore =true)]
		public string[] InterestValue { get { 
				if(string.IsNullOrWhiteSpace(InterestData))
				{
					return new string[1];
				}else
				{
					return InterestData.Split(',');
				}
			} }
		[JsonPropertyName("username")] public string UserName { get; set; }

		[JsonPropertyName("sex")] public string Sex { get; set; } = "男";

		[JsonPropertyName("phone")] public string Phone { get; set; } = "";

		[JsonPropertyName("area")] public string Area { get; set; } = "";

		[JsonPropertyName("jun")] public string Jun { get; set; } = "是";
		[JsonPropertyName("status")] public int Status { get; set; }

		[JsonPropertyName("userId")]
		public string UserId { get; set; } = "";
		[JsonPropertyName("createDate")]
		public DateTime CreateDate { get; set; } = DateTime.Now;

        [Navigate(nameof(UserId))]
        public UserInfo	UserInfo  { get; set; }
	  
    }
}
